<div class="usernamelastname"><?php echo $sf_user->isAuthenticated() ? link_to($user['firstname']. ' ' .$user['lastname'], 'myaccount/index?account='.$user['id']) : $user['firstname']. ' ' .$user['lastname'] ; ?></div>
<div class="userphoto"><img src='/uploads/avatars/thumbnail_50_50_n/<?php echo ($user['image']!=NULL?$user['image']:'noimage.png') ?>' /></div>